<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout"
	layout:decorator="layout">
<head>
<title>公司信息管理</title>
</head>
<body>
	<div layout:fragment="content" class="jumbotron">
		<form class="form-horizontal" role="form" th:action="@{/admin/company}" method="post" th:object="${company}">
		  <input type="hidden"  th:name="${_csrf.parameterName}" th:value="${_csrf.token}"/>
			<div class="form-group">
				<label class="control-label col-sm-2">公司名称:</label>
				<div class="col-sm-10">
					<input class="form-control" id="name" placeholder="公司名称" th:field="${company.fullName}"/>
				</div>
			</div>
			<div class="form-group">
				<label class="control-label col-sm-2">公司LOGO:</label>
				<div class="col-sm-10">
					<input class="form-control" id="logo" placeholder="公司LOGO文字" th:field="${company.logo}"/>
				</div>
			</div>
			<div class="form-group">
			    <label class="control-label col-sm-2">公司LOGO图片:</label>
				<div id="pickCultureResourceFileContainer" class="col-sm-10">
                	<button type="button" class="btn btn-default " id="pickCultureResourceFile" style="width:200px;"> 
                		<i class="glyphicon glyphicon-plus"></i> <span>选择文件</span>
                	</button>
              	</div>
			</div>
			<div>
			   <img src=""></img>
			</div>
			<div class="form-group row row-centered" >
			<label class="control-label col-sm-2">公司联系信息:</label>
				<table id="contactInfos" class="table table-striped">
                    <tr>
                        <th class="col-sm-1">座机</th>
                        <th class="col-sm-1">电话</th>
                        <th class="col-sm-1">QQ</th>
                        <th class="col-sm-1">微信</th>
                        <th class="col-sm-1">邮箱</th>
                        <th class="col-sm-1"></th>
                    </tr>
                    <tr th:each="contactInfo, rowStat : *{contactInfos}">
                        <td class="col-sm-1"><input type="text" class="form-control" th:field="*{contactInfos[__${rowStat.index}__].phone}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control" th:field="*{contactInfos[__${rowStat.index}__].mobile}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control input-button-right" th:field="*{contactInfos[__${rowStat.index}__].qq}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control input-button-right" th:field="*{contactInfos[__${rowStat.index}__].wechat}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control input-button-right" th:field="*{contactInfos[__${rowStat.index}__].email}"/></td>
                        <td class="col-sm-1">
                        	<span class="col-sm-1 row-delete-button">
                        		<button type="button" class="btn btn-default" name="removeContactPhone" th:id="${'contactInfo'+__${rowStat.index}__}">
                                   <i class="glyphicon glyphicon-trash icon-white"></i>
                        	 	</button>
                        	</span>
                        </td>
                    </tr>
                    <tr>
                   		<td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1">
                        	<span class="col-sm-1 row-add-button">
                        		<button type="button" class="btn btn-success btn-add" id="addContactInfo">
                                   <i class="glyphicon glyphicon-plus icon-green"></i>
                        	 	</button>
                        	</span>
                        </td>
                    </tr>
                </table>
			</div>
			
			<div class="form-group row row-centered">
				<label class="control-label col-sm-2">友情链接:</label>
				<table id="friendLinks" class="table table-striped">
                    <tr>
                        <th class="col-sm-1">链接名</th>
                        <th class="col-sm-1">链接描述</th>
                        <th class="col-sm-1">链接地址</th>
                        <th class="col-sm-1"></th>
                    </tr>
                    <tr th:each="friendLink, rowStat : *{friendLinks}">
                        <td class="col-sm-1"><input type="text" class="form-control" th:field="*{friendLinks[__${rowStat.index}__].title}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control" th:field="*{friendLinks[__${rowStat.index}__].description}"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control input-button-right" th:field="*{friendLinks[__${rowStat.index}__].url}"/></td>
						<td class="col-sm-1"> 
							<span class="col-sm-1 row-delete-button">
                        		<button type="button" class="btn btn-default" name="removeFriendLink" th:id="${'friendLink'+__${rowStat.index}__}">
                                   <i class="glyphicon glyphicon-trash icon-white"></i>
                        	 	</button>
                        	</span>
                        </td>                    
                    </tr>
                    <tr>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
                        <td class="col-sm-1"><input type="text" class="form-control"/></td>
						<td class="col-sm-1"> 
							<span class="col-sm-1 row-add-button">
                        		<button type="button" class="btn btn-success btn-add" id="addFriendLink">
                                   <i class="glyphicon glyphicon-plus icon-green"></i>
                        	 	</button>
                        	</span>
                        </td>                    
                    </tr>
                </table>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<button type="submit" class="btn btn-default">保存</button>
				</div>
			</div>
		</form>
	</div>
</body>
</html>